using System;
using System.Configuration;
using System.ServiceModel;
using System.Reflection;
using System.ServiceModel.Activation;
using System.Runtime.Serialization;
using CompanyX.TechnicalArchitecture.Factories;
using CompanyX.Insurance.La.DataContracts;
using CompanyX.Insurance.La.FaultContracts;
using CompanyX.Insurance.La.ServiceContracts;

/// <summary>
/// The framework's service end-point of L&amp;A producer licensing &amp; appointments. This service end-point
/// is designed to be ACORD v2.18.02 compliant (includes Microsoft-FSG specific schema 
/// extensions for operation faults). By default, this service uses the framework's 
/// provider however, the provider can be plugged into the appropriate backend system/service 
/// with optional message transformations
/// </summary>
/// <remarks>Security model is based on typical role definitions for the applicable process</remarks>
[ServiceBehavior(Name = "ProducerLicensingAndAppointmentsService", Namespace = "urn:CompanyX.Insurance.La.ServiceContracts")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class ProducerLicensingAndAppointmentsService : IProducerLicensingAndAppointments
{
    #region IProducerLicensingAndAppointments Members

    public TXLifeResponse RequestProducerLicense(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetProducerLicensingDetails(TXLifeRequest request)
    {
        ProviderFactoryConfig config = (ProviderFactoryConfig)ConfigurationManager.GetSection("serviceProviders");
        AssemblyName providerAssemblyName = new AssemblyName(config.Providers["LifeServiceProvider"].AssemblyFullName);
        ProviderFactory.LoadProvider(providerAssemblyName);

        IProducerLicensingAndAppointments provider = ProviderFactory.GetProvider<IProducerLicensingAndAppointments>();
        return provider.GetProducerLicensingDetails(request);
    }

    public TXLifeResponse ReassignProducerForHouseholdHoldings(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse GetProducerDetails(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse SendProducerDetails(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse RequestProducerAppointment(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse RenewProducerAppointment(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse NotifyProducerAppointmentNonRenewal(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    public TXLifeResponse TerminateProducerAppointment(TXLifeRequest request)
    {
        throw new Exception("The method or operation is not implemented.");
    }

    #endregion
}